<!--商品图片-->
<div id="focus" class="focus goods-focus ect-padding-lr ect-margin-tb">
    <div class="hd">
        <ul>
        </ul>
    </div>
    <div class="bd">
        <ul id="Gallery">
            <?php
            if($this->goods_images) {
            $imageCount = count($this->goods_images) - 1;
            foreach($this->goods_images as $image_k => $image_v) {
            ?>
            <li><a href="#"><img src="<?php echo $this->basePath($this->frontwebsite()->shopGoodsImage($image_v['goods_thumbnail_image'])); ?>"/></a></li>
            <?php
            } } else {
            ?>
            <li><img src="<?php echo $this->basePath($this->frontwebsite()->shopGoodsImage($this->goods_info->goods_thumbnail_image)); ?>"/></li>
            <?php } ?>
        </ul>
    </div>
</div>

<div class="goods-info ect-padding-tb">
    <section class="ect-margin-tb ect-margin-lr goods-title">
        <h4 class="title pull-left"><?php echo $this->escapeHtml($this->goods_info->goods_name); ?> <font color="#ed145b"><?php echo $this->escapeHtml($this->goods_info->goods_extend_name); ?></font></h4>
          <span id="ECS_COLLECT" onclick="add_favorites_js(<?php echo $this->goods_info->goods_id; ?>, <?php echo $this->class_id; ?>);" class="pull-right text-center  ect-padding-lr <?php if ($this->favorites_state == 'true') echo 'ect-colory'; ?>"> <i class="fa <?php echo ($this->favorites_state == 'true' ? 'fa-heart' : 'fa-heart-o'); ?>"></i><br>
              <?php echo $this->translate('收藏'); ?> </span>
    </section>
    <?php $userGroupPriceShowState = $this->frontwebsite()->getDbshopGoodsIni('dbshop_goods_usergroup_price_show'); ?>
    <section class="ect-margin-tb ect-margin-lr ">
        <p>
            <?php echo $this->translate('货　号'); ?>：<span id="goods_item"><?php echo $this->escapeHtml($this->goods_info->goods_item); ?></span>
        </p>
        <p>
            <span class="pull-left">
                <?php $front_goods_price=intval($this->goods_info->goods_price); if( $front_goods_price>0) { ?>
                <?php echo $this->translate('市场价'); ?>：<del><?php echo $this->frontwebsite()->shopPriceExtend($this->goods_info->goods_price); ?></del>
                <?php } ?>
            </span>
            <span class="pull-right"><?php echo $this->translate('销量'); ?>：<?php echo intval($this->order_count); ?> <?php echo $this->translate('件'); ?></span>
        </p>
        <?php if ($this->goods_info->goods_preferential_price <= 0) { ?>
        <p><?php echo $this->translate('店铺价'); ?>：<b id="goods_price" class="ect-colory"><?php echo $this->frontwebsite()->shopPriceExtend($this->goods_info->goods_shop_price); ?></b></p>
            <?php
            if($userGroupPriceShowState == 1) {
            ?>
            <p class="group_price" style="<?php if(empty($this->group_price)) { ?>display: none;<?php } ?>"><?php echo $this->translate('会员价'); ?>：
            <span id="group_price_str">
                        <?php
                        if(isset($this->group_price) and !empty($this->group_price)) {
                            foreach($this->group_price as $group_price_value) {
                                ?>
                                <?php echo $this->escapeHtml($group_price_value['group_name']); ?><strong style="color:#ED145B;"><?php echo $this->frontwebsite()->shopPriceExtend($group_price_value['group_price']); ?></strong>&nbsp;
                            <?php } } ?>
            </span>
            </p>
            <?php } ?>
        <?php } else { ?>
        <p><?php echo $this->translate('优惠价'); ?>：<b id="goods_price"><?php echo $this->frontwebsite()->shopPriceExtend($this->goods_info->goods_preferential_price); ?></b></p>
        <?php } ?>

        <?php
        if (isset($this->goods_custom) and !empty($this->goods_custom)) {
        foreach($this->goods_custom as $gc_value) {
        ?>
        <p><?php echo $this->escapeHtml($gc_value['custom_title']); ?>：<?php echo $this->escapeHtml($gc_value['custom_content']); ?></p>
        <?php } } ?>
        <p><?php echo $this->translate('库存'); ?>：<span id="goods_stock_show"><?php echo $this->goods_stock; ?></span></p>
        <?php if($this->goods_info->goods_weight > 0) { ?>
        <p><?php echo $this->translate('重量'); ?>：<?php echo $this->goods_info->goods_weight; ?><?php echo $this->translate('千克'); ?></p>
        <?php } ?>

        <?php if(isset($this->click_coupon) and !empty($this->click_coupon)) { ?>
        <?php foreach ($this->click_coupon as $clickCouponValue) { ?>
            <div style="min-width: 50px;height: 26px;background:#E5004F;line-height:26px;color: #fff;display: inline-block;text-align: center;padding-right: 15px;padding-left: 5px;">
                <?=$this->translate('满')?><?=$this->frontwebsite()->currencyPrice($clickCouponValue['shopping_amount'], $this->frontwebsite()->getFrontDefaultCurrency())?><?=$this->translate('减')?><?=$this->frontwebsite()->currencyPrice($clickCouponValue['shopping_discount'], $this->frontwebsite()->getFrontDefaultCurrency())?>
            </div>
            <span style="border-right:1px dashed #fff;position: relative;left: -14px;"></span>
            <div style="width: 10px;height: 10px;border-radius: 50%;background: #fff;display: inline-block;margin-left: -10px;position: relative;">
            </div>
        <?php } ?>
        <span>
            <a style="text-decoration: underline;" href="<?php echo $this->url('m_goods/default',array('action'=>'clickCoupon'), array('query'=>array('goods_id'=>$this->goods_info->goods_id)));?>"><?=$this->translate('点击领券')?></a>
         </span>
        <?php } ?>

        <?php if(isset($this->goods_info->goods_integral_num) and $this->goods_info->goods_integral_num > 0) { ?>
        <p><b><?php echo $this->translate('可用'); ?>&nbsp;<span id="goods_integral"><?php echo $this->goods_info->goods_integral_num; ?></span>&nbsp;<?php echo $this->translate('消费积分进行购买'); ?></b></p>
        <?php } ?>
    </section>

    <form action="<?php echo $this->url('frontcart/default'); ?>" method="post" name="add_goods_cart" id="add_goods_cart">

        <section class="ect-padding-lr ect-padding-tb goods-option">
            <?php if(isset($this->relation_goods_array) and !empty($this->relation_goods_array)) { ?>
                <div class="clearfix" style="margin-bottom:15px;margin-top: 10px;">
                    <div>
                        <?php foreach($this->relation_goods_array as $relationGoods) { ?>
                            <a title="<?php echo $this->escapeHtml($relationGoods['goods_name']); ?>" href="<?php echo $this->url('frontgoods/default', array('goods_id'=>$relationGoods['goods_id'], 'class_id'=>$relationGoods['one_class_id'])); ?>">
                                <img src="<?php echo $this->basePath($this->frontwebsite()->shopGoodsImage($relationGoods['goods_thumbnail_image'])); ?>" style="border: 1px solid <?php echo ($relationGoods['goods_id'] == $this->goods_info->goods_id ? '#BD0021' : '#D7D7D7'); ?>;width: 40px;margin-right: 5px;">
                            </a>
                        <?php } ?>
                    </div>
                </div>
            <?php } ?>
            <div class="goods-optionc">
                <?php
                if(isset($this->goods_spec_group_array) and !empty($this->goods_spec_group_array)) {
                foreach ($this->goods_spec_group_array as $spec_group_value) {
                if(isset($this->spec_tag_id)) {
                ?>
                <div class="goods-option-con"> <span><?php echo $this->escapeHtml($spec_group_value['tag_group_name']); ?>：</span>
                    <div class="goods-option-conr goods_spec_<?php echo $spec_group_value['tag_group_id']; ?> goods_spec_tag_item">
                        <?php foreach ($this->spec_tag_id[$spec_group_value['tag_group_id']] as $spec_tag_id) { ?>
                            <input type="radio" onclick="get_goods_stock()" checked="" id="spec_value_<?php echo $spec_tag_id; ?>" value="<?php echo $spec_tag_id; ?>" name="select_tag_group_<?php echo $spec_group_value['tag_group_id']; ?>_value">
                            <?php if(!empty($this->spec_tag[$spec_tag_id]['tag_str'])) { ?>
                                <label for="spec_value_<?php echo $spec_tag_id; ?>" style="background-color:<?php echo $this->spec_tag[$spec_tag_id]['tag_str']; ?>;">&nbsp;&nbsp;</label>
                            <?php } else { ?>
                                <label for="spec_value_<?php echo $spec_tag_id; ?>"><?php echo $this->escapeHtml($this->spec_tag[$spec_tag_id]['tag_name']); ?></label>
                            <?php } ?>
                        <?php } ?>
                    </div>
                </div>
                <?php } } ?>
                <input type="hidden" name="selected_spec_tag_id_str" id="selected_spec_tag_id_str" value="">
                <?php } ?>
            </div>

            <div class="goods-num"> <span class="pull-left"><?php echo $this->translate('购买数量'); ?>：</span>
                <div class="input-group pull-left wrap"><span id="add_down" class="input-group-addon sup">-</span>
                    <input type="text" value="<?php echo ($this->goods_info->goods_cart_buy_min_num > 1 ? $this->goods_info->goods_cart_buy_min_num : 1); ?>" autocomplete="off" id="buy_goods_num" name="buy_goods_num" class="form-contro form-num">
                    <span id="add_up" class="input-group-addon plus">+</span></div>

            </div>
        </section>


        <input type="hidden" id="goods_id" name="goods_id" value="<?php echo $this->goods_info->goods_id; ?>" />
        <input type="hidden" id="class_id" name="class_id" value="<?php echo $this->class_id; ?>" />
        <div class="ect-padding-lr ect-padding-tb goods-submit">
            <?php if ($this->goods_info->goods_state == 1) { ?>
                <div><a onclick="add_cart_js();" class="btn btn-info ect-btn-info ect-colorf" type="botton"><?php echo $this->translate('立即购买'); ?></a></div>
            <?php } elseif ($this->goods_info->goods_state == 2) { ?>
                <div><b style="color: red;font-size: 18px;"><?php echo $this->translate('该商品已经下架！'); ?></b></div>
            <?php } ?>

        </div>
    </form>


        <section class="user-tab ect-border-bottom0">
            <div style="height: 3.15em; display: none;" id="is-nav-tabs"></div>

            <ul class="nav nav-tabs text-center">
                <li class="col-xs-4 active"><a data-toggle="tab" role="tab" href="#one"><?php echo $this->translate('商品描述'); ?></a></li>
                <li class="col-xs-4"><a data-toggle="tab" role="tab" href="#two"><?php echo $this->translate('商品评价'); ?>(<span id="comment_span"></span>)</a></li>
                <li class="col-xs-4"><a data-toggle="tab" role="tab" href="#three"><?php echo $this->translate('商品咨询'); ?>(<span id="ask_span"></span>)</a></li>
            </ul>

            <div class="tab-content">
                <div id="one" class="tab-pane tab-info active" style="min-height: 194.667px;">
                    <?php
                    if(isset($this->goods_attribute) and !empty($this->goods_attribute)) {
                    foreach($this->goods_attribute as $b_key => $b_val) {
                        ?>
                        <?php echo $b_val; ?><br>
                    <?php } echo '<br>'; } ?>
                    <?php echo $this->frontwebsite()->shopGoogsBody($this->goods_info->goods_body); ?>
                </div>
                <div id="two" class="tab-pane tab-att" style="min-height: 194.667px;">
                    <div id="list_goodscomment"></div>
                </div>
                <div id="three" class="tab-pane tab-msg" style="min-height: 194.667px;">
                    <ul class="msg">
                        <div>
                            <div id="list_goodsask"></div>

                            <div class="submit-comments">
                                <form id="ask_form" name="ask_form" method="post">
                                    <div class="ect-padding-lr">
                                        <p class="ect-padding-tb">
                                            <textarea placeholder="<?php echo $this->translate('您有任何问题，可以通过这里向卖家咨询'); ?>" name="goods_ask_content" id="goods_ask_content"></textarea>
                                        </p>
                                        <?php if ($this->frontwebsite()->websiteCaptchaState('goods_ask_captcha') == 'true') { ?>
                                        <p class="ect-padding-tb code" style="height: 90px;">
                                            <span>
                                            <input type="text" name="captcha_code" id="captcha_code" placeholder="<?php echo $this->translate('输入验证码'); ?>">
                                            </span> <img id="ask_captcha_id" src="" onclick="captchaAdd();" class="pull-right">
                                        </p>
                                        <?php } ?>
                                        <p class="ect-padding-tb">
                                            <input type="hidden" name="goods_id" value="<?php echo $this->goods_info->goods_id; ?>" />
                                            <input type="submit" value="<?php echo $this->translate('提交咨询'); ?>" class="btn btn-info ect-btn-info">
                                        </p>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </ul>
                </div>
            </div>
        </section>
    </div>
<script>
    $(document).ready(function() {
        $("#ask_form").validate({
            success : function(label){
                label.addClass('validate_right').text('OK!');
            },
            rules: {
                goods_ask_content: {
                    required: true
                }
                <?php if ($this->frontwebsite()->websiteCaptchaState('goods_ask_captcha') == 'true') { ?>
                ,
                captcha_code: {
                    required:true,
                    remote :{
                        url : '<?php echo $this->url('shopfront/default/captcha-check',array('action'=>'captcha','captcha_check'=>1)); ?>',
                        type : 'post',
                        date : {
                            captcha_code :function(){
                                return $("#captcha_code").val();
                            }
                        }
                    }
                }
                <?php } ?>
            },
            messages: {
                goods_ask_content: {
                    required: "<?php echo $this->translate('请输入商品咨询内容！'); ?>"
                }
                <?php if ($this->frontwebsite()->websiteCaptchaState('goods_ask_captcha') == 'true') { ?>
                ,
                captcha_code: {
                    required:"<?php echo $this->translate('验证码不能为空！'); ?>",
                    remote : "<?php echo $this->translate('验证码错误！'); ?>"
                }
                <?php } ?>
            },
            submitHandler:function(form){
                add_goods_ask_js();
            }
        });
    });
    //添加商品咨询
    function add_goods_ask_js() {
        $.post("<?php echo $this->url('frontgoods/default', array('action'=>'addAsk')); ?>",$('#ask_form').formSerialize(),
            function(data){
                if(data == 'true') {
                    $('#goods_ask_content').val('');
                    <?php if ($this->frontwebsite()->websiteCaptchaState('goods_ask_captcha') == 'true') { ?>
                    $('#captcha_code').val('');
                    captchaAdd();
                    <?php } ?>
                    alert('<?php echo $this->translate('您的咨询信息已经成功提交，卖家审核回复后，将正常显示！'); ?>');
                } else {
                    alert(data);
                }
            });
    }
    //添加购物车
    function add_cart_js() {
        $.post("<?php echo $this->url('frontcart/default', array('action'=>'addCart')); ?>",$('#add_goods_cart').formSerialize(),
            function(data){
                if(data == 'true') {
                    if (confirm('<?php echo $this->translate('添加购物车成功，是否去购物车结算'); ?>')) {
                        window.location.href = '<?php echo $this->url('m_cart/default'); ?>';
                    }

                } else {
                    alert(data);
                    if(data.indexOf("Login") != -1) window.location.href = '<?php echo $this->url('m_user/default', array('action' => 'login')); ?>';
                }
            });
    }
    //添加收藏
    function add_favorites_js(goods_id,class_id) {
        $.post("<?php echo $this->url('frontuser/default',array('action'=>'addFavorites')); ?>",{goods_id:goods_id,class_id:class_id},
            function(data){
                if(data == 'true') {
                    $('#ECS_COLLECT').addClass("ect-colory")
                    $('#ECS_COLLECT i').addClass("fa-heart").removeClass("fa-heart-o");
                    alert('<?php echo $this->translate('该商品成功加入收藏！'); ?>');
                } else {
                    var message = '';
                    if(data == 'login_false') {
                        message = '<?php echo $this->translate('您还没有登录，无法收藏商品！'); ?>';
                    } else if (data == 'goods_exists') {
                        message = '<?php echo $this->translate('您已经收藏过该商品！'); ?>';
                    } else {
                        message = '<?php echo $this->translate('商品收藏不成功！'); ?>';
                    }
                    alert(message);
                }
            });
    }
    $("#add_up").click(function() {
        var buy_num = $("#buy_goods_num").val();
        var max_num = <?php echo $this->goods_info->goods_cart_buy_max_num; ?>;
        if(buy_num >= max_num && max_num != 0) {
            alert('<?php echo $this->translate('您已经到了购买上限！'); ?>');
            return false;
        }
        $("#buy_goods_num").val(accAdd(buy_num,1));
    });
    $("#add_down").click(function() {
        var buy_num = $("#buy_goods_num").val();
        var min_num = 1;
        if(buy_num <= min_num) {
            alert('<?php echo $this->translate('您已经到了购买下限！'); ?>');
            return false;
        }
        $("#buy_goods_num").val(Subtr(buy_num,1));
    });
    //如果有尺寸和颜色，并且已经选择了，那么获取相关库存
    function get_goods_stock() {
        var spec_tag_id = [];
        <?php
        if(isset($this->spec_tag_id)) {
            foreach ($this->goods_spec_group_array as $spec_group_value) {
            ?>
            spec_tag_id.push($("input[name='select_tag_group_<?php echo $spec_group_value['tag_group_id']; ?>_value']:checked").val());
        <?php } ?>
        $("#selected_spec_tag_id_str").val(spec_tag_id.toString());
        $.post("<?php echo $this->url('frontgoods/default',array('action'=>'goodsStock','goods_id'=>$this->goods_info->goods_id)); ?>",{spec_tag_id_str:spec_tag_id.toString()},
            function(data){
                if(data != '') {
                    $('#goods_stock_show').html(data.stock);
                    $('#goods_item').html(data.goods_item);
                    <?php if ($this->goods_info->goods_preferential_price <= 0) { ?>
                    $('#goods_price').html(data.price);
                    <?php } ?>
                    <?php if($userGroupPriceShowState == 1 and $this->goods_info->goods_preferential_price <= 0) { ?>
                    if(data.group_price_str == '') {
                        $('.group_price').hide();
                    } else {
                        $('.group_price').show();
                        $('#group_price_str').html(data.group_price_str);
                    }
                    <?php } ?>
                    if(data.goods_integral > 0) $('#goods_integral').html(data.goods_integral);
                }
            },
            'json');
        <?php } ?>
    }
    get_goods_stock();

    <?php if ($this->frontwebsite()->websiteCaptchaState('goods_ask_captcha') == 'true') { ?>
    //验证码添加
    function captchaAdd() {
        $.get("<?php echo $this->url('shopfront/default',array('action'=>'captcha')); ?>",{},
            function(data){
                $("#ask_captcha_id").attr('src', '<?php echo $this->basePath('/'); ?>'+data.captcha_file);
            },'json');
    }
    captchaAdd();
    <?php } ?>
    //商品评价列表
    function comment_ajax_list(list_url) {
        $.get(list_url,'', function(html){
            $("#list_goodscomment").html(html);
        });
    }
    comment_ajax_list('<?php echo $this->url('m_goods/default',array('action'=>'listComment'),array('query'=>array('goods_id'=>$this->goods_info->goods_id, 'class_id'=>$this->class_id))); ?>');
    //商品咨询列表获取
    function ask_ajax_list(list_url) {
        $.get(list_url,'', function(html){
            $("#list_goodsask").html(html);
        });
    }
    ask_ajax_list('<?php echo $this->url('m_goods/default',array('action'=>'goodsAsk'),array('query'=>array('goods_id'=>$this->goods_info->goods_id, 'class_id'=>$this->class_id))); ?>');
</script>

<?php if(strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') !== false) { ?>
    <?php
    $shareExtendUrl = '';
    if($this->frontwebsite()->getUserSession('user_id') > 0) {
        $shareExtendUrl = '?user_id='.$this->frontwebsite()->getUserSession('user_id').'&md5='.md5($this->goods_info->goods_id * 2);
    }
    ?>
    <script type="text/javascript" src='https://res.wx.qq.com/open/js/jweixin-1.4.0.js'></script>
    <script type="text/javascript">
        wx.config({
            debug: false,
            appId: '<?php echo $this->signPackage['appId']; ?>',
            timestamp: '<?php echo $this->signPackage['timestamp']; ?>',
            nonceStr: '<?php echo $this->signPackage['nonceStr']; ?>',
            signature: '<?php echo $this->signPackage['signature']; ?>',
            jsApiList: [
                // 所有要调用的 API 都要加到这个列表中
                'checkJsApi',
                'onMenuShareTimeline',
                'onMenuShareAppMessage',
                'onMenuShareQQ',
                'onMenuShareWeibo',
                'onMenuShareQZone'
            ]
        });
        wx.ready(function () {
            <?php
            $shareImage = $this->basePath($this->frontwebsite()->shopGoodsImage($this->goods_info->goods_thumbnail_image));
            $shareImage = (strpos($shareImage, 'http') !== false ? '' : $this->serverUrl()).$shareImage;
            ?>
            // 微信分享的数据
            var shareData = {
                "imgUrl" : '<?php echo $shareImage; ?>',    // 分享显示的缩略图地址
                "link" : '<?php echo $this->serverUrl().$this->url('m_goods/default', array('goods_id'=>$this->goods_info->goods_id, 'class_id'=>$this->class_id)).$shareExtendUrl; ?>',    // 分享地址
                "desc" : '<?php echo $this->escapeHtml($this->goods_info->goods_description); ?>',   // 分享描述
                "title" : '<?php echo $this->escapeHtml($this->goods_info->goods_name); ?>',   // 分享标题
                success : function () {
                    $.post("<?php echo $this->url('m_goods/default',array('action'=>'shareReturn')); ?>",{goods_id:<?=$this->goods_info->goods_id; ?>, md5_str:'<?=$this->shareMd5Str; ?>', type:'Timeline'},
                        function(data){
                            if(data.state == 'true') {
                                alert(data.message);
                                window.location.href='<?=$this->url('m_goods/default', array('goods_id'=>$this->goods_info->goods_id, 'class_id'=>$this->class_id)) ?>';
                            }
                        }, 'json');
                }};
            var shareData1 = {
                "imgUrl" : '<?php echo $shareImage; ?>',    // 分享显示的缩略图地址
                "link" : '<?php echo $this->serverUrl().$this->url('m_goods/default', array('goods_id'=>$this->goods_info->goods_id, 'class_id'=>$this->class_id)).$shareExtendUrl; ?>',    // 分享地址
                "desc" : '<?php echo $this->escapeHtml($this->goods_info->goods_description); ?>',   // 分享描述
                "title" : '<?php echo $this->escapeHtml($this->goods_info->goods_name); ?>',   // 分享标题
                success : function () {
                    $.post("<?php echo $this->url('m_goods/default',array('action'=>'shareReturn')); ?>",{goods_id:<?=$this->goods_info->goods_id; ?>, md5_str:'<?=$this->shareMd5Str; ?>', type:'AppMessage'},
                        function(data){
                            if(data.state == 'true') {
                                alert(data.message);
                                window.location.href='<?=$this->url('m_goods/default', array('goods_id'=>$this->goods_info->goods_id, 'class_id'=>$this->class_id)) ?>';
                            }
                        }, 'json');
                }};
            var shareData2 = {
                "imgUrl" : '<?php echo $shareImage; ?>',    // 分享显示的缩略图地址
                "link" : '<?php echo $this->serverUrl().$this->url('m_goods/default', array('goods_id'=>$this->goods_info->goods_id, 'class_id'=>$this->class_id)).$shareExtendUrl; ?>',    // 分享地址
                "desc" : '<?php echo $this->escapeHtml($this->goods_info->goods_description); ?>',   // 分享描述
                "title" : '<?php echo $this->escapeHtml($this->goods_info->goods_name); ?>',   // 分享标题
                success : function () {
                    $.post("<?php echo $this->url('m_goods/default',array('action'=>'shareReturn')); ?>",{goods_id:<?=$this->goods_info->goods_id; ?>, md5_str:'<?=$this->shareMd5Str; ?>', type:'QQ'},
                        function(data){
                            if(data.state == 'true') {
                                alert(data.message);
                                window.location.href='<?=$this->url('m_goods/default', array('goods_id'=>$this->goods_info->goods_id, 'class_id'=>$this->class_id)) ?>';
                            }
                        }, 'json');
                }};
            var shareData3 = {
                "imgUrl" : '<?php echo $shareImage; ?>',    // 分享显示的缩略图地址
                "link" : '<?php echo $this->serverUrl().$this->url('m_goods/default', array('goods_id'=>$this->goods_info->goods_id, 'class_id'=>$this->class_id)).$shareExtendUrl; ?>',    // 分享地址
                "desc" : '<?php echo $this->escapeHtml($this->goods_info->goods_description); ?>',   // 分享描述
                "title" : '<?php echo $this->escapeHtml($this->goods_info->goods_name); ?>',   // 分享标题
                success : function () {
                    $.post("<?php echo $this->url('m_goods/default',array('action'=>'shareReturn')); ?>",{goods_id:<?=$this->goods_info->goods_id; ?>, md5_str:'<?=$this->shareMd5Str; ?>', type:'Weibo'},
                        function(data){
                            if(data.state == 'true') {
                                alert(data.message);
                                window.location.href='<?=$this->url('m_goods/default', array('goods_id'=>$this->goods_info->goods_id, 'class_id'=>$this->class_id)) ?>';
                            }
                        }, 'json');
                }};
            var shareData4 = {
                "imgUrl" : '<?php echo $shareImage; ?>',    // 分享显示的缩略图地址
                "link" : '<?php echo $this->serverUrl().$this->url('m_goods/default', array('goods_id'=>$this->goods_info->goods_id, 'class_id'=>$this->class_id)).$shareExtendUrl; ?>',    // 分享地址
                "desc" : '<?php echo $this->escapeHtml($this->goods_info->goods_description); ?>',   // 分享描述
                "title" : '<?php echo $this->escapeHtml($this->goods_info->goods_name); ?>',   // 分享标题
                success : function () {
                    $.post("<?php echo $this->url('m_goods/default',array('action'=>'shareReturn')); ?>",{goods_id:<?=$this->goods_info->goods_id; ?>, md5_str:'<?=$this->shareMd5Str; ?>', type:'QZone'},
                        function(data){
                            if(data.state == 'true') {
                                alert(data.message);
                                window.location.href='<?=$this->url('m_goods/default', array('goods_id'=>$this->goods_info->goods_id, 'class_id'=>$this->class_id)) ?>';
                            }
                        }, 'json');
                }};

            wx.onMenuShareTimeline(shareData);
            wx.onMenuShareAppMessage(shareData1);
            wx.onMenuShareQQ(shareData2);
            wx.onMenuShareWeibo(shareData3);
            wx.onMenuShareQZone(shareData4);
        });


        wx.error(function(res){

        });
    </script>
<?php } ?>